import {contextBridge, ipcRenderer} from 'electron'

contextBridge.exposeInMainWorld('api', {
  request: (options: {
    url: string
    method?: 'GET' | 'POST' | 'PUT' | 'DELETE'
    data?: any
    params?: any
    headers?: Record<string, string>
  }) => ipcRenderer.invoke('api:request', options),
})